	TITLE VECTOR SUBSYSTEM OF SYSTEM MONITOR RELEASE A
;  ******Donated to the Pascal/Z Users Group,July 1980*****
;	INTEL I/O STANDARD VECTOR SUBSYSTEM
;	FOR THE SYSTEM MONITOR
;
;	MODIFIED FOR C-MACRO ASSEMBLER MAY 1979
;
;
;	EXTERNAL LINKAGES
;
;MBASE IS MONITOR BASE
;CBASE IS CONSOLE SUBSYSTEM BASE
;TBASE IS CASSETTE SUBSYSTEM BASE
;WBASE IS MONITOR WORK SPACE
;
;
;	LINKAGES TO CONSOLE SUBSYSTEM
;
CSTATS	DEFL	CBASE+3
CKEYIN	DEFL	CBASE+6
CLISTR	DEFL	CBASE+0CH
CVOUT	DEFL	CBASE+18H
;
;	LINKAGES TO CASSETTE SUBSYSTEM
;
TSAVE	DEFL	TBASE+3
TLOAD	DEFL	TBASE+6
;
;	LINKAGES TO MONITOR

MSTRT	DEFL	MBASE
MRSTRT	DEFL	MBASE+3
MMEMRY	DEFL	MBASE+6

;START OF MONITOR CODE
;
VBASE	EQU	$
;
;	EXTERNAL ENTRY VECTORS
;
;	INTEL STANDARD I/O
;
VNTRY0	JP	MSTRT	;COLD START OF MONITOR
VNTRY1	JP	CINP	;CONSOL INPUT
VNTRY2	JP	RINP	;READER INPUT
VNTRY3	JP	COUT	;CONSOL OUTPUT
VNTRY4	JP	POUT	;PUNCH OUTPUT
VNTRY5	JP	LOUT	;LINE PRINTER OUTPUT
VNTRY6	JP	CSTA	;CONSOL STATUS
VNTRY7	JP	IOCH	;I/O CHECK
VNTRY8	JP	IOST	;I/O SET
VNTRY9	JP	MTST	;MEMORY TEST
VNTRYA	JP	MRSTRT	;WARM START OF MONITOR
;
;	SUBSYSTEM BASE ADDRESSES
VCADDR	DEFW	CBASE	;CONSOLE SUBSYSTEM BASE ADDR
VTADDR	DEFW	TBASE	;CASSETTE SUBSYSTEM BASE ADDR
VDADDR	DEFW	DBASE	;DISK SUBSYSTEM BASE ADDR
;
VWORK	DEFW	WBASE	;MONITOR VAR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